﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebApiCore.Config
{
    public class AppConfig
    {
        /// <summary>
        /// 获取配置  
        /// </summary>
        /// <returns></returns>
        public static IConfigurationRoot GetConfig(string fileName)
        {
            try
            {
                var builder = new ConfigurationBuilder().AddJsonFile(fileName);
                return builder.Build();
            }
            catch (Exception)
            {
                return null;
            }
            
        }
    }
}
